package cn.xuchunh.campusbbs.bean;

import android.os.Parcel;
import android.os.Parcelable;

/**
 * 板块
 * Created by XuChunH on 2015/9/12.
 */
public class Forum implements Parcelable{

    private int id;
    private String name;
    private String desc;
    private boolean child;
    private String icon;
    private long lastPostsDate;
    private int content;
    private String forumRedirect;
    private int todayPostsNum;
    private int topicTotalNum;
    private int postsTotalNum;
    private boolean focus;

    public Forum() {
    }

    protected Forum(Parcel in) {
        id = in.readInt();
        name = in.readString();
        desc = in.readString();
        child = in.readByte() != 0;
        icon = in.readString();
        lastPostsDate = in.readLong();
        content = in.readInt();
        forumRedirect = in.readString();
        todayPostsNum = in.readInt();
        topicTotalNum = in.readInt();
        postsTotalNum = in.readInt();
        focus = in.readByte() != 0;
    }

    public static final Creator<Forum> CREATOR = new Creator<Forum>() {
        @Override
        public Forum createFromParcel(Parcel in) {
            return new Forum(in);
        }

        @Override
        public Forum[] newArray(int size) {
            return new Forum[size];
        }
    };

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    public boolean hasChild() {
        return child;
    }

    public void setChild(boolean child) {
        this.child = child;
    }

    public String getIcon() {
        return icon;
    }

    public void setIcon(String icon) {
        this.icon = icon;
    }

    public long getLastPostsDate() {
        return lastPostsDate;
    }

    public void setLastPostsDate(long lastPostsDate) {
        this.lastPostsDate = lastPostsDate;
    }

    public int getContent() {
        return content;
    }

    public void setContent(int content) {
        this.content = content;
    }

    public String getForumRedirect() {
        return forumRedirect;
    }

    public void setForumRedirect(String forumRedirect) {
        this.forumRedirect = forumRedirect;
    }

    public int getTodayPostsNum() {
        return todayPostsNum;
    }

    public void setTodayPostsNum(int todayPostsNum) {
        this.todayPostsNum = todayPostsNum;
    }

    public int getTopicTotalNum() {
        return topicTotalNum;
    }

    public void setTopicTotalNum(int topicTotalNum) {
        this.topicTotalNum = topicTotalNum;
    }

    public int getPostsTotalNum() {
        return postsTotalNum;
    }

    public void setPostsTotalNum(int postsTotalNum) {
        this.postsTotalNum = postsTotalNum;
    }

    public boolean isFocus() {
        return focus;
    }

    public void setFocus(boolean focus) {
        this.focus = focus;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeInt(id);
        dest.writeString(name);
        dest.writeString(desc);
        dest.writeByte((byte) (child ? 1 : 0));
        dest.writeString(icon);
        dest.writeLong(lastPostsDate);
        dest.writeInt(content);
        dest.writeString(forumRedirect);
        dest.writeInt(todayPostsNum);
        dest.writeInt(topicTotalNum);
        dest.writeInt(postsTotalNum);
        dest.writeByte((byte) (focus ? 1 : 0));
    }
}
